'use strict';

var mongoose = require('mongoose');

var DishModel = function () {

    //Define a super simple schema for our products.
    var dishSchema = mongoose.Schema({
        name: String,
        available: Boolean
    });

    /**
     * Verbose toString method
     */
    dishSchema.methods.whatAmI = function () {
        var greeting = this.name ?
            'Hello, I\'m a ' + this.name + ' and I\'m worth $' + this.available
            : 'I don\'t have a name :(';
        console.log(greeting);
    };


    return mongoose.model('Dish', dishSchema);

};

module.exports = new DishModel();